package com.hyz.login.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hyz.login.model.Bed;
import com.hyz.login.mapper.BedMapper;
import com.hyz.login.service.BedService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zwq
 * @since 2022-11-19
 */
@Service
public class BedServiceImpl
        extends ServiceImpl<BedMapper, Bed> implements BedService {

    @Autowired
    private BedMapper bedMapper;

    @Override
    public List<Bed> findAll() {
        QueryWrapper<Bed> wrapper = new QueryWrapper<Bed>();
        return bedMapper.selectList(wrapper);
    }

    @Override
    public List<Bed> findByDepId(Integer depId) {
        QueryWrapper<Bed> wrapper = new QueryWrapper<Bed>();
        wrapper.eq("departmentId",depId);
        return bedMapper.selectList(wrapper);
    }
}
